package main

import (
	dbpl "3Party/DBPool"
	"fmt"
)

var (
	g_dbpool *dbpl.DBPool
)

func init() {
	pool, err := dbpl.NewDBPool()
	if err != nil {
		panic("new db pool err" + err.toString())
	}
	g_dbpool = pool
}

func main() {

	insert := &InserUserInfo{
		uid:  "111",
		name: "threadfly",
		age:  24,
		sex:  MAN,
	}

	g_dbpool.Write(insert)

	query := &QueryUserInfo{
		uid: "111",
		ret: make(chan map[string]string),
	}

	g_dbpool.Write(query)

	resultmap := <-query.ret
}
